package com.stylefeng.guns.modular.tool;

import com.stylefeng.HCNetSDK;
import com.sun.jna.NativeLong;

public  class lianjie {
    static HCNetSDK hCNetSDK = HCNetSDK.INSTANCE;

    public static NativeLong lianjie(String ips,String ports,String name ,String pwd) {
        hCNetSDK.NET_DVR_Init();
        hCNetSDK.NET_DVR_SetConnectTime(2000, 1);
        hCNetSDK.NET_DVR_SetReconnect(10000, true);
        HCNetSDK.NET_DVR_DEVICEINFO_V30 m_strDeviceInfo = new HCNetSDK.NET_DVR_DEVICEINFO_V30();
        NativeLong IUserID;
        String ip = ips;
        int nports=Integer.parseInt(ports);
        short nportss= (short)nports;
        short port = nportss;
        String userName = name;
        String password = pwd;
        IUserID = hCNetSDK.NET_DVR_Login_V30(ip, port, userName, password, m_strDeviceInfo);
        if (IUserID.equals("")) {
            System.out.println("错误日子" + hCNetSDK.NET_DVR_GetLastError());

        }
        return IUserID;
    }
}

